package com.design.absfactory.factory;

import com.design.absfactory.impl.AmdMainboard;
import com.design.absfactory.impl.IntelMainboard;
import com.design.absfactory.inter.Mainboard;

/**
 * Created by Administrator on 2016/8/27.
 */
public class MainboardFactory {

    /**
     * 简单工厂
     * @param type
     * @return
     */
    public static Mainboard createMainboard(int type) {
        Mainboard mainboard = null;
        if (type == 1) {
            mainboard = new IntelMainboard(755);
        } else if (type == 2) {
            mainboard = new AmdMainboard(938);
        }
        return mainboard;
    }
}
